package com.service;

import com.dao.ReaderCommentDao;
import com.dto.ReaderCommentDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author linyukun
 * @date 2022/10/10 16:42
 */
@Service
public class ReaderCommentServiceImpl {
    @Autowired
    private ReaderCommentDao readerCommentDao;

    public Object addReaderComment(ReaderCommentDTO dto) {
        return readerCommentDao.addReaderComment(dto);
    }

    public Object delReaderComment(ReaderCommentDTO dto) {
        return readerCommentDao.delReaderComment(dto);
    }

    public Object getReaderCommentList(ReaderCommentDTO dto) {
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        return new PageInfo(readerCommentDao.getReaderCommentList(dto));
    }

    public Object replyReaderReply(ReaderCommentDTO dto) {
        return readerCommentDao.replyReaderReply(dto);
    }
}
